<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{$title}-{$Think.lang.web_name}</title>
    {include file="comm/header"/}
</head>
<body>
{include file="comm/left_menu"/}
{include file="comm/top_menu"/}
<div class="container main">
    <div class="col-sm-12 border-bottom text-right"><a class="btn btn-primary mgr-10" href="/Content/category_list/id/{$category.cate_id}"><i class="fa fa-list-ul"></i>&nbsp;{$Think.lang.category_list}</a></div>

    <div class="col-sm-12">
        <div class="col-sm-12"> &nbsp;</div>
        <form class="form-horizontal" method="post" action="/Content/category_save/">

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.cate_name}</label>
                <div class="col-sm-3">
                    <input class="form-control" name="cate_name" value="{$category.cate_name}" required>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.cate_order}</label>
                <div class="col-sm-3">
                    <input type="number" class="form-control" name="cate_order" value="{if $category.cate_order}{$category.cate_order}{else}0{/if}" required>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">{$Think.lang.cate_type}</label>
                <div class="col-sm-5">
                    {foreach name="model_list" key="key" id="v" index="i"}
                    <label class="s-label-radio">
                        <input type="radio" name="cate_type" value="{$v.model_id}" id="cate_type{$i}" {if in_array($category.cate_type,[$v.model_id])} checked {/if}>
                        <label for="cate_type{$i}" class="fa fa-check"></label> {$v.model_name}
                    </label>
                    {/foreach}
                </div>
                <small class="col-sm-1 form-tips"></small>
            </div>



            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-3">
                    <input type="hidden" name="cate_id" value="{$category.cate_id}">
                    <input type="hidden" name="token" value="">
                    <button class="btn btn-primary" type="submit">提交保存</button>
                </div>
                <small class="col-sm-4 form-tips"></small>
            </div>

        </form>
    </div>
</div>
{include file="comm/footer"/}
<script type="text/javascript">
    function all_select() {
        var checked = $("input[name*='[checked]']");
        for (var i=0,len=checked.length;i<len;i++){
            checked[i].checked = true;
        }
    }
    function not_all_select() {
        var checked = $("input[name*='[checked]']");
        //$("input[name='group_rules[]']").removeAttr("checked");
        //$("input[name='group_rules[]']").attr("checked",false);
        for (var i=0,len=checked.length;i<len;i++){
            checked[i].checked = false;
        }
    }
    
</script>
</body>
</html>